package com.liveneo.adapter.mobile.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.google.common.collect.Sets;
import com.liveneo.adapter.base.entity.PrpmCaseInfo;
import com.liveneo.adapter.base.entity.PrpmLossItem;
import com.liveneo.adapter.base.mapper.PrpmCaseInfoMapper;
import com.liveneo.adapter.base.mapper.PrpmLossItemMapper;
import com.liveneo.adapter.base.support.BaseServiceImpl;
import com.liveneo.adapter.mobile.model.request.CaseListRequest;
import com.liveneo.adapter.mobile.service.MobileCaseService;
import com.liveneo.adapter.mobile.service.ValidateService;
import com.liveneo.system.base.utils.AppException;

/**
 * 案件信息服务类
 * 
 * @author wangxx
 *
 * @since 2016-06-12
 */
@Service
public class MobileCaseServiceImpl extends BaseServiceImpl implements MobileCaseService {
//    @Autowired
//    private CaseInfoDao     caseInfoDao;
//    @Autowired
//    private LossItemDao     lossItemDao;
    @Autowired
    PrpmCaseInfoMapper prpmCaseInfoMapper;
    @Autowired
    PrpmLossItemMapper prpmLossItemMapper;


    /**
     * @Title: 获取案件信息
     * @Description: TODO
     * @param @param caseNo
     * @param @return 设定文件
     * @return PrpmCaseInfo 返回类型
     * @throws
     */
    public PrpmCaseInfo getCaseInfoByCaseNo(String caseNo) {
        List<PrpmCaseInfo> cases = prpmCaseInfoMapper.getCaseInfoByCaseNo(caseNo);
        return cases.size() > 0 ? cases.get(0) : null;
    }

    @Override
    public PrpmCaseInfo getCaseInfoByUuid(String caseUuid) {
        return prpmCaseInfoMapper.selectByPrimaryKey(caseUuid);
    }

    @Override
    public int updateCaseInfoReFlag(PrpmCaseInfo caseInfo) {
        return prpmCaseInfoMapper.updateByPrimaryKeySelective(caseInfo);
    }

    @Override
    public int updateCaseInfoById(PrpmCaseInfo caseInfo) {
        return prpmCaseInfoMapper.updateByPrimaryKeySelective(caseInfo);
    }
}
